﻿var status = 0;

var time = java.util.Calendar.getInstance();
var year = time.get(java.util.Calendar.YEAR); //获得年份
var month = time.get(java.util.Calendar.MONTH) + 1; //获得月份
var day = time.get(java.util.Calendar.DATE); //获取日
var hour = time.get(java.util.Calendar.HOUR_OF_DAY); //获得小时
var minute = time.get(java.util.Calendar.MINUTE); //获得分钟
var second = time.get(java.util.Calendar.SECOND); //获得秒
var tz20 = "#fEffect/CharacterEff/1114000/1/0#"; //红星花
//var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
//var eff1 = "#fEffect/CharacterEff/1112949/3/0#"; //花样音符
var eff1 = "#fUI/StarCityUI.img/GradeInfo/icon_ss/7#"
var z = "#fUI/UIWindow/Quest/icon5/1#"; //"+z+"//美化
var kkk = "#fEffect/CharacterEff/1051296/1/0#";
var p2 = "#fUI/SoulUI.img/DungeonMap/icon/dungeonItem/0#"
var tz12 = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
        cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
        cm.dispose();
    } else if (status == 0) {
        var selStr = "\t" + "欢迎来到" + cm.getServerName() + "冒险岛地图传送门#k\r\n";



        selStr += "#L0#" + tz20 + "#d城镇传送#l";
        selStr += "#L4#" + tz20 + "#d升级地图#l";
        selStr += "#L1#" + tz20 + "#d组队地图#l\r\n";
        selStr += "\r\n#d-------------------------------------------------#k\r\n";
        selStr += "#L2#" + tz20 + "#dBOSS副本#l";
        selStr += "#L3#" + tz20 + "#d娱乐副本#l";
        selStr += "#L9#" + tz20 + "#d野外小怪#l\r\n";
        selStr += "\r\n#d-------------------------------------------------#k\r\n";
        selStr += "#L5#" + tz20 + "#d跳跳地图#l";
        //selStr += "#L6#" + tz20 + "#d家族通道#l";
        //selStr += "#L7#" + tz20 + "#d美容美发#l\r\n\r\n";
        selStr += "#L8#" + tz20 + "#d豹弩游侠#l";
        selStr += "#L10#" + tz20 + "#d扭蛋地图#l\r\n";

        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {

            case 0: //快捷地图
                cm.dispose();
                cm.openNpc(0, "快捷传送");
                break;
            case 1: //组队副本
                cm.dispose();
                cm.openNpc(9310382, 3232);
                break;
            case 2: //BOSS副本
                cm.worldSpouseMessage(0x18, "[BOSS最新消息]:~~~~~ " + cm.getChar().getName() + " ~~~~~准备去挑战BOSS了！")
                cm.dispose();
                cm.openNpc(0, "BOSS传送");
                break;
            case 3: //娱乐副本
                cm.dispose();
                cm.openNpc(0, "娱乐副本");
                break;
            case 4: //升级地图
                cm.dispose();
                cm.openNpc(0, "升级地图");
                break;
            case 5: //跳跳地图
                cm.dispose();
                cm.openNpc(0, "跳跳地图");
                break;
            case 6: //家族通道
                cm.dispose();
                cm.warp(200000301);
                break;
            case 7: //美容美发
                cm.dispose();
                cm.warp(100000104);
                break;
            case 8: //豹弩游侠
                cm.dispose();
                cm.warp(931000500);
                break;
            case 9: //豹弩游侠
                cm.dispose();
                cm.openNpc(0, "野外小怪");
                break;
            case 10:
                cm.dispose();
                cm.warp(749050400);
                break;
        }
    }
}